from langchain_core.tools import tool
from pydantic import BaseModel, Field

"""
class CaculatorInput(BaseModel):
    a: int = Field(description="第一个参数")
    b: int = Field(description="第二个参数")
@tool("multiply_toll",args_schema=CaculatorInput,return_direct=True,description="hello")
def multiply(a:int,b:int)->int:
    return a*b
"""
@tool(parse_docstring=True)
def multiply(a:int,b:int)->int:
    """The multiply_tool.

    Args:
        a:第一个参数.
        b:第二个参数.
    """
    return a*b
print("函数名称",multiply.name)
print("函数描述",multiply.description)
print("函数参数",multiply.args)
print("是否直接返回",multiply.return_direct)

print(multiply.invoke({"a":8,"b":8}))
